package io.xccit.oshiapp.common.service.impl;

import io.xccit.oshiapp.common.service.ICpuService;
import io.xccit.oshiapp.util.OshiUtil;
import org.springframework.stereotype.Service;

/**
 * @author CH_ywx
 * @version 1.0
 * @create 2024/12/17
 * <p>Cpu服务层</p>
 */
@Service
public class CpuServiceImpl implements ICpuService {
    /**
     * 获取cpu信息
     *
     * @return
     */
    @Override
    public String getCpuInfo() {
        return OshiUtil.getCpuInfo();
    }

    /**
     * 获取cpu线程每秒使用率
     *
     * @return
     */
    @Override
    public double[] getCpuCoreUsagePerSecond() {
        return OshiUtil.getCpuCoreUsagePerSecond();
    }
}
